<template>
	<view class="good-item" @click="goto()">
		<view class="good-image">
			<!-- {{item.servicePathIcon}} -->
			<!-- <image :src="item.servicePathIcon" mode=""></image> -->
			<!-- <image :src="item.servicePath?item.servicePath:'/static/images/good.png'" mode="aspectFill"></image> -->
		<uv-image :src="item.servicePathIcon" width="100%" height="100%" bgColor="#fff"></uv-image>
		</view>
		<view class="good-cont">
			<view class="good-name break1">
				{{item.serviceName}}
			</view>
			<view class="time">
				服务时间：<text>{{item.serviceDate}}</text>分钟
			</view>
			<view class="good-foot flex-between">
				<view class="price">
					￥{{item.servicePrice}}
				</view>
				<view class="saleNum">
					已售{{item.serviceSold}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "goods-item",
		data() {
			return {

			};
		},
		props:{
			item: {
				type: Object,
				default: {}
			},
		},
		methods:{
			goto(){
				this.$store.dispatch('saveData', {
					field: 'placeOrder',
					value:{},
					// keep: true,
				})
				uni.navigateTo({
					url:'/pages/productDetails/productDetails?serviceId='+this.item.serviceId
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.good-item {
		width: 339rpx;
		border-radius: 20rpx;
		overflow: hidden;
		margin-bottom: 20rpx;

		.good-image {
			width: 100%;
			height: 241rpx;
			background: #fff;
			image{
				width: 100%;
				height: 100%;
			}
		}
		.good-cont {
				width: 339rpx;
				// height: 184rpx;
				background-color: #ffffff;
				padding: 15px;
				box-sizing: border-box;
				overflow: hidden;
			
				.good-name{
					font-weight: bold;
					
				}
				.time{
					color: #666;
					font-size: 24rpx;
					margin-top: 10rpx;
					margin-bottom: 30rpx;
					text{
						color: #00bb00;
						
						font-size: 24rpx;
					}
				}
			}
		
	}
	.good-foot{
		align-items: center;
	}
	.price{
		color: #ff0000;
		text{
			color: #999;
			text-decoration: line-through;
		}
	}
	.saleNum{
		color: #666;
		font-size: 24rpx;
	}
</style>